From 8599b10a9dc249e4a29c8309bf8ea85a7486ecd3 Mon Sep 17 00:00:00 2001 From: Hiranya Jayathilaka Date: Wed, 27 Jan 2021 16:33:11 -0800 Subject: [PATCH 1/2] chore: Generating separate API reports for module entry points --- api-extractor.json | 330 +------------- etc/firebase-admin.api.md | 618 +++++--------------------- etc/firebase-admin.app.api.md | 76 ++++ etc/firebase-admin.auth.api.md | 589 ++++++++++++++++++++++++ etc/firebase-admin.database.api.md | 77 ++++ etc/firebase-admin.instance-id.api.md | 32 ++ generate-reports.js | 90 ++++ package.json | 4 +- src/default-namespace.d.ts | 20 +- 9 files changed, 986 insertions(+), 850 deletions(-) create mode 100644 etc/firebase-admin.app.api.md create mode 100644 etc/firebase-admin.auth.api.md create mode 100644 etc/firebase-admin.database.api.md create mode 100644 etc/firebase-admin.instance-id.api.md create mode 100644 generate-reports.js diff --git a/api-extractor.json b/api-extractor.json index 6f5a35e026..44a05957d6 100644 --- a/api-extractor.json +++ b/api-extractor.json @@ -1,338 +1,32 @@ -/** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - /** - * Optionally specifies another JSON config file that this file extends from. This provides a way for - * standard settings to be shared across multiple projects. - * - * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains - * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be - * resolved using NodeJS require(). - * - * SUPPORTED TOKENS: none - * DEFAULT VALUE: "" - */ - // "extends": "./shared/api-extractor-base.json" - // "extends": "my-package/include/api-extractor-base.json" - - /** - * Determines the "" token that can be used with other config file settings. The project folder - * typically contains the tsconfig.json and package.json config files, but the path is user-defined. - * - * The path is resolved relative to the folder of the config file that contains the setting. - * - * The default value for "projectFolder" is the token "", which means the folder is determined by traversing - * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder - * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error - * will be reported. - * - * SUPPORTED TOKENS: - * DEFAULT VALUE: "" - */ - // "projectFolder": "..", - - /** - * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor - * analyzes the symbols exported by this module. - * - * The file extension must be ".d.ts" and not ".ts". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - */ - // We point to the default-namespace.d.ts file since index.d.ts uses namespace imports that are - // not supported by API Extractor. See https://github.com/microsoft/rushstack/issues/1029 and - // https://github.com/microsoft/rushstack/issues/2338. "mainEntryPointFilePath": "/lib/default-namespace.d.ts", - - /** - * A list of NPM package names whose exports should be treated as part of this package. - * - * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", - * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part - * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly - * imports library2. To avoid this, we can specify: - * - * "bundledPackages": [ "library2" ], - * - * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been - * local files for library1. - */ "bundledPackages": [], - - /** - * Determines how the TypeScript compiler engine will be invoked by API Extractor. - */ "compiler": { - /** - * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * Note: This setting will be ignored if "overrideTsconfig" is used. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/tsconfig.json" - */ - // "tsconfigFilePath": "/tsconfig.json", - /** - * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. - * The object must conform to the TypeScript tsconfig schema: - * - * http://json.schemastore.org/tsconfig - * - * If omitted, then the tsconfig.json file will be read from the "projectFolder". - * - * DEFAULT VALUE: no overrideTsconfig section - */ - // "overrideTsconfig": { - // . . . - // } - /** - * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended - * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when - * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses - * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. - * - * DEFAULT VALUE: false - */ - // "skipLibCheck": true, - }, - /** - * Configures how the API report file (*.api.md) will be generated. - */ + }, "apiReport": { - /** - * (REQUIRED) Whether to generate an API report. - */ - "enabled": true - - /** - * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce - * a full file path. - * - * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". - * - * SUPPORTED TOKENS: , - * DEFAULT VALUE: ".api.md" - */ - // "reportFileName": ".api.md", - - /** - * Specifies the folder where the API report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, - * e.g. for an API review. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/etc/" - */ - // "reportFolder": "/etc/", - - /** - * Specifies the folder where the temporary report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * After the temporary file is written to disk, it is compared with the file in the "reportFolder". - * If they are different, a production build will fail. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/" - */ - // "reportTempFolder": "/temp/" + "enabled": true, + "reportFileName": "" }, - - /** - * Configures how the doc model file (*.api.json) will be generated. - */ "docModel": { - /** - * (REQUIRED) Whether to generate a doc model file. - */ "enabled": true - - /** - * The output path for the doc model file. The file extension should be ".api.json". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/.api.json" - */ - // "apiJsonFilePath": "/temp/.api.json" }, - - /** - * Configures how the .d.ts rollup file will be generated. - */ "dtsRollup": { - /** - * (REQUIRED) Whether to generate the .d.ts rollup file. - */ "enabled": false - - /** - * Specifies the output path for a .d.ts rollup file to be generated without any trimming. - * This file will include all declarations that are exported by the main entry point. - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/dist/.d.ts" - */ - // "untrimmedFilePath": "/dist/.d.ts", - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. - * This file will include only declarations that are marked as "@public" or "@beta". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "betaTrimmedFilePath": "/dist/-beta.d.ts", - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. - * This file will include only declarations that are marked as "@public". - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "publicTrimmedFilePath": "/dist/-public.d.ts", - - /** - * When a declaration is trimmed, by default it will be replaced by a code comment such as - * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the - * declaration completely. - * - * DEFAULT VALUE: false - */ - // "omitTrimmingComments": true }, - - /** - * Configures how the tsdoc-metadata.json file will be generated. - */ "tsdocMetadata": { - /** - * Whether to generate the tsdoc-metadata.json file. - * - * DEFAULT VALUE: true - */ - // "enabled": true, - /** - * Specifies where the TSDoc metadata file should be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", - * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup - * falls back to "tsdoc-metadata.json" in the package folder. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" - }, - - /** - * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files - * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. - * To use the OS's default newline kind, specify "os". - * - * DEFAULT VALUE: "crlf" - */ - // "newlineKind": "crlf", - /** - * Configures how API Extractor reports error and warning messages produced during analysis. - * - * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. - */ + }, "messages": { - /** - * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing - * the input .d.ts files. - * - * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ "compilerMessageReporting": { - /** - * Configures the default routing for messages that don't match an explicit rule in this table. - */ "default": { - /** - * Specifies whether the message should be written to the the tool's output log. Note that - * the "addToApiReportFile" property may supersede this option. - * - * Possible values: "error", "warning", "none" - * - * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail - * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes - * the "--local" option), the warning is displayed but the build will not fail. - * - * DEFAULT VALUE: "warning" - */ "logLevel": "warning" - - /** - * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), - * then the message will be written inside that file; otherwise, the message is instead logged according to - * the "logLevel" option. - * - * DEFAULT VALUE: false - */ - // "addToApiReportFile": false } - - // "TS2551": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . }, - - /** - * Configures handling of messages reported by API Extractor during its analysis. - * - * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" - * - * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings - */ "extractorMessageReporting": { "default": { "logLevel": "warning" - // "addToApiReportFile": false }, "ae-missing-release-tag": { @@ -343,26 +37,10 @@ "logLevel": "none" } }, - - /** - * Configures handling of messages reported by the TSDoc parser when analyzing code comments. - * - * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ "tsdocMessageReporting": { "default": { "logLevel": "none" - // "addToApiReportFile": false } - - // "tsdoc-link-tag-unescaped-text": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . } } } diff --git a/etc/firebase-admin.api.md b/etc/firebase-admin.api.md index fff4aa60ae..db1e843ede 100644 --- a/etc/firebase-admin.api.md +++ b/etc/firebase-admin.api.md @@ -6,30 +6,9 @@ import { Agent } from 'http'; import { Bucket } from '@google-cloud/storage'; -import { DataSnapshot } from '@firebase/database-types'; -import { EventType } from '@firebase/database-types'; import { FirebaseDatabase } from '@firebase/database-types'; import * as _firestore from '@google-cloud/firestore'; -import { OnDisconnect } from '@firebase/database-types'; -import { Query } from '@firebase/database-types'; -import { Reference } from '@firebase/database-types'; import * as rtdb from '@firebase/database-types'; -import { ThenableReference } from '@firebase/database-types'; - -// @public -export interface ActionCodeSettings { - android?: { - packageName: string; - installApp?: boolean; - minimumVersion?: string; - }; - dynamicLinkDomain?: string; - handleCodeInApp?: boolean; - iOS?: { - bundleId: string; - }; - url: string; -} // @public (undocumented) export interface App { @@ -84,190 +63,220 @@ export interface AppOptions { // @public (undocumented) export const apps: (app.App | null)[]; -// @public -export class Auth extends BaseAuth { - get app(): App; - tenantManager(): TenantManager; - } - // @public export function auth(app?: App): auth.Auth; // @public (undocumented) export namespace auth { + // Warning: (ae-forgotten-export) The symbol "ActionCodeSettings" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type ActionCodeSettings = ActionCodeSettings; + // Warning: (ae-forgotten-export) The symbol "Auth" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type Auth = Auth; + // Warning: (ae-forgotten-export) The symbol "AuthFactorType" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type AuthFactorType = AuthFactorType; + // Warning: (ae-forgotten-export) The symbol "AuthProviderConfig" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type AuthProviderConfig = AuthProviderConfig; + // Warning: (ae-forgotten-export) The symbol "AuthProviderConfigFilter" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type AuthProviderConfigFilter = AuthProviderConfigFilter; + // Warning: (ae-forgotten-export) The symbol "BaseAuth" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type BaseAuth = BaseAuth; + // Warning: (ae-forgotten-export) The symbol "CreateMultiFactorInfoRequest" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type CreateMultiFactorInfoRequest = CreateMultiFactorInfoRequest; + // Warning: (ae-forgotten-export) The symbol "CreatePhoneMultiFactorInfoRequest" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type CreatePhoneMultiFactorInfoRequest = CreatePhoneMultiFactorInfoRequest; + // Warning: (ae-forgotten-export) The symbol "CreateRequest" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type CreateRequest = CreateRequest; + // Warning: (ae-forgotten-export) The symbol "CreateTenantRequest" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type CreateTenantRequest = CreateTenantRequest; + // Warning: (ae-forgotten-export) The symbol "DecodedIdToken" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type DecodedIdToken = DecodedIdToken; + // Warning: (ae-forgotten-export) The symbol "DeleteUsersResult" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type DeleteUsersResult = DeleteUsersResult; + // Warning: (ae-forgotten-export) The symbol "EmailIdentifier" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type EmailIdentifier = EmailIdentifier; + // Warning: (ae-forgotten-export) The symbol "EmailSignInProviderConfig" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type EmailSignInProviderConfig = EmailSignInProviderConfig; + // Warning: (ae-forgotten-export) The symbol "GetUsersResult" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type GetUsersResult = GetUsersResult; + // Warning: (ae-forgotten-export) The symbol "HashAlgorithmType" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type HashAlgorithmType = HashAlgorithmType; + // Warning: (ae-forgotten-export) The symbol "ListProviderConfigResults" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type ListProviderConfigResults = ListProviderConfigResults; + // Warning: (ae-forgotten-export) The symbol "ListTenantsResult" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type ListTenantsResult = ListTenantsResult; + // Warning: (ae-forgotten-export) The symbol "ListUsersResult" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type ListUsersResult = ListUsersResult; + // Warning: (ae-forgotten-export) The symbol "MultiFactorConfig" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type MultiFactorConfig = MultiFactorConfig; + // Warning: (ae-forgotten-export) The symbol "MultiFactorConfigState" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type MultiFactorConfigState = MultiFactorConfigState; + // Warning: (ae-forgotten-export) The symbol "MultiFactorCreateSettings" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type MultiFactorCreateSettings = MultiFactorCreateSettings; + // Warning: (ae-forgotten-export) The symbol "MultiFactorInfo" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type MultiFactorInfo = MultiFactorInfo; + // Warning: (ae-forgotten-export) The symbol "MultiFactorSettings" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type MultiFactorSettings = MultiFactorSettings; + // Warning: (ae-forgotten-export) The symbol "MultiFactorUpdateSettings" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type MultiFactorUpdateSettings = MultiFactorUpdateSettings; + // Warning: (ae-forgotten-export) The symbol "OIDCAuthProviderConfig" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type OIDCAuthProviderConfig = OIDCAuthProviderConfig; + // Warning: (ae-forgotten-export) The symbol "OIDCUpdateAuthProviderRequest" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type OIDCUpdateAuthProviderRequest = OIDCUpdateAuthProviderRequest; + // Warning: (ae-forgotten-export) The symbol "PhoneIdentifier" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type PhoneIdentifier = PhoneIdentifier; + // Warning: (ae-forgotten-export) The symbol "PhoneMultiFactorInfo" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type PhoneMultiFactorInfo = PhoneMultiFactorInfo; + // Warning: (ae-forgotten-export) The symbol "ProviderIdentifier" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type ProviderIdentifier = ProviderIdentifier; + // Warning: (ae-forgotten-export) The symbol "SAMLAuthProviderConfig" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type SAMLAuthProviderConfig = SAMLAuthProviderConfig; + // Warning: (ae-forgotten-export) The symbol "SAMLUpdateAuthProviderRequest" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type SAMLUpdateAuthProviderRequest = SAMLUpdateAuthProviderRequest; + // Warning: (ae-forgotten-export) The symbol "SessionCookieOptions" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type SessionCookieOptions = SessionCookieOptions; + // Warning: (ae-forgotten-export) The symbol "Tenant" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type Tenant = Tenant; + // Warning: (ae-forgotten-export) The symbol "TenantAwareAuth" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type TenantAwareAuth = TenantAwareAuth; + // Warning: (ae-forgotten-export) The symbol "TenantManager" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type TenantManager = TenantManager; + // Warning: (ae-forgotten-export) The symbol "UidIdentifier" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UidIdentifier = UidIdentifier; + // Warning: (ae-forgotten-export) The symbol "UpdateAuthProviderRequest" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UpdateAuthProviderRequest = UpdateAuthProviderRequest; + // Warning: (ae-forgotten-export) The symbol "UpdateMultiFactorInfoRequest" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UpdateMultiFactorInfoRequest = UpdateMultiFactorInfoRequest; + // Warning: (ae-forgotten-export) The symbol "UpdatePhoneMultiFactorInfoRequest" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UpdatePhoneMultiFactorInfoRequest = UpdatePhoneMultiFactorInfoRequest; + // Warning: (ae-forgotten-export) The symbol "UpdateRequest" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UpdateRequest = UpdateRequest; + // Warning: (ae-forgotten-export) The symbol "UpdateTenantRequest" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UpdateTenantRequest = UpdateTenantRequest; + // Warning: (ae-forgotten-export) The symbol "UserIdentifier" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UserIdentifier = UserIdentifier; + // Warning: (ae-forgotten-export) The symbol "UserImportOptions" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UserImportOptions = UserImportOptions; + // Warning: (ae-forgotten-export) The symbol "UserImportRecord" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UserImportRecord = UserImportRecord; + // Warning: (ae-forgotten-export) The symbol "UserImportResult" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UserImportResult = UserImportResult; + // Warning: (ae-forgotten-export) The symbol "UserInfo" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UserInfo = UserInfo; + // Warning: (ae-forgotten-export) The symbol "UserMetadata" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UserMetadata = UserMetadata; + // Warning: (ae-forgotten-export) The symbol "UserMetadataRequest" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UserMetadataRequest = UserMetadataRequest; + // Warning: (ae-forgotten-export) The symbol "UserProviderRequest" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UserProviderRequest = UserProviderRequest; + // Warning: (ae-forgotten-export) The symbol "UserRecord" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type UserRecord = UserRecord; } -// @public -export type AuthFactorType = 'phone'; - -// @public -export interface AuthProviderConfig { - displayName?: string; - enabled: boolean; - providerId: string; -} - -// @public -export interface AuthProviderConfigFilter { - maxResults?: number; - pageToken?: string; - type: 'saml' | 'oidc'; -} - -// @public -export class BaseAuth { - createCustomToken(uid: string, developerClaims?: object): Promise; - createProviderConfig(config: AuthProviderConfig): Promise; - createSessionCookie(idToken: string, sessionCookieOptions: SessionCookieOptions): Promise; - createUser(properties: CreateRequest): Promise; - deleteProviderConfig(providerId: string): Promise; - deleteUser(uid: string): Promise; - // (undocumented) - deleteUsers(uids: string[]): Promise; - generateEmailVerificationLink(email: string, actionCodeSettings?: ActionCodeSettings): Promise; - generatePasswordResetLink(email: string, actionCodeSettings?: ActionCodeSettings): Promise; - generateSignInWithEmailLink(email: string, actionCodeSettings: ActionCodeSettings): Promise; - getProviderConfig(providerId: string): Promise; - getUser(uid: string): Promise; - getUserByEmail(email: string): Promise; - getUserByPhoneNumber(phoneNumber: string): Promise; - getUsers(identifiers: UserIdentifier[]): Promise; - importUsers(users: UserImportRecord[], options?: UserImportOptions): Promise; - listProviderConfigs(options: AuthProviderConfigFilter): Promise; - listUsers(maxResults?: number, pageToken?: string): Promise; - revokeRefreshTokens(uid: string): Promise; - setCustomUserClaims(uid: string, customUserClaims: object | null): Promise; - updateProviderConfig(providerId: string, updatedConfig: UpdateAuthProviderRequest): Promise; - updateUser(uid: string, properties: UpdateRequest): Promise; - verifyIdToken(idToken: string, checkRevoked?: boolean): Promise; - verifySessionCookie(sessionCookie: string, checkRevoked?: boolean): Promise; -} - // @public (undocumented) export function cert(serviceAccountPathOrObject: string | ServiceAccount, httpAgent?: Agent): Credential; -// @public -export interface CreateMultiFactorInfoRequest { - displayName?: string; - factorId: string; -} - -// @public -export interface CreatePhoneMultiFactorInfoRequest extends CreateMultiFactorInfoRequest { - phoneNumber: string; -} - -// @public -export interface CreateRequest extends UpdateRequest { - multiFactor?: MultiFactorCreateSettings; - uid?: string; -} - -// @public -export type CreateTenantRequest = UpdateTenantRequest; - // @public (undocumented) export interface Credential { getAccessToken(): Promise; @@ -281,18 +290,13 @@ export namespace credential { const refreshToken: typeof refreshToken; } -// @public (undocumented) -export interface Database extends FirebaseDatabase { - getRules(): Promise; - getRulesJSON(): Promise; - setRules(source: string | Buffer | object): Promise; -} - // @public export function database(app?: App): database.Database; // @public (undocumented) export namespace database { + // Warning: (ae-forgotten-export) The symbol "Database" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type Database = Database; // (undocumented) @@ -312,62 +316,9 @@ export namespace database { const ServerValue: rtdb.ServerValue; } -export { DataSnapshot } - -// @public -export interface DecodedIdToken { - // (undocumented) - [key: string]: any; - aud: string; - auth_time: number; - email?: string; - email_verified?: boolean; - exp: number; - firebase: { - identities: { - [key: string]: any; - }; - sign_in_provider: string; - sign_in_second_factor?: string; - second_factor_identifier?: string; - tenant?: string; - [key: string]: any; - }; - iat: number; - iss: string; - phone_number?: string; - picture?: string; - sub: string; - uid: string; -} - // @public (undocumented) export function deleteApp(app: App): Promise; -// @public -export interface DeleteUsersResult { - errors: FirebaseArrayIndexError[]; - failureCount: number; - successCount: number; -} - -// @public -export interface EmailIdentifier { - // (undocumented) - email: string; -} - -// @public -export interface EmailSignInProviderConfig { - enabled: boolean; - passwordRequired?: boolean; -} - -// @public (undocumented) -export const enableLogging: typeof rtdb.enableLogging; - -export { EventType } - // @public export interface FirebaseArrayIndexError { error: FirebaseError; @@ -424,24 +375,6 @@ export function getApp(name?: string): App; // @public (undocumented) export function getApps(): App[]; -// @public (undocumented) -export function getAuth(app?: App): Auth; - -// @public (undocumented) -export function getDatabase(app?: App): Database; - -// @public (undocumented) -export function getDatabaseWithUrl(url: string, app?: App): Database; - -// @public (undocumented) -export function getInstanceId(app?: App): InstanceId; - -// @public -export interface GetUsersResult { - notFound: UserIdentifier[]; - users: UserRecord[]; -} - // @public export interface GoogleOAuthAccessToken { // (undocumented) @@ -450,45 +383,20 @@ export interface GoogleOAuthAccessToken { expires_in: number; } -// @public (undocumented) -export type HashAlgorithmType = 'SCRYPT' | 'STANDARD_SCRYPT' | 'HMAC_SHA512' | 'HMAC_SHA256' | 'HMAC_SHA1' | 'HMAC_MD5' | 'MD5' | 'PBKDF_SHA1' | 'BCRYPT' | 'PBKDF2_SHA256' | 'SHA512' | 'SHA256' | 'SHA1'; - // @public (undocumented) export function initializeApp(options?: AppOptions, name?: string): app.App; -// @public -export class InstanceId { - get app(): App; - deleteInstanceId(instanceId: string): Promise; - } - // @public export function instanceId(app?: App): instanceId.InstanceId; // @public (undocumented) export namespace instanceId { + // Warning: (ae-forgotten-export) The symbol "InstanceId" needs to be exported by the entry point default-namespace.d.ts + // // (undocumented) export type InstanceId = InstanceId; } -// @public -export interface ListProviderConfigResults { - pageToken?: string; - providerConfigs: AuthProviderConfig[]; -} - -// @public -export interface ListTenantsResult { - pageToken?: string; - tenants: Tenant[]; -} - -// @public -export interface ListUsersResult { - pageToken?: string; - users: UserRecord[]; -} - // @public export function machineLearning(app?: app.App): machineLearning.MachineLearning; @@ -843,74 +751,6 @@ export namespace messaging { {}; } -// @public (undocumented) -export interface MultiFactorConfig { - factorIds?: AuthFactorType[]; - state: MultiFactorConfigState; -} - -// @public -export type MultiFactorConfigState = 'ENABLED' | 'DISABLED'; - -// @public -export interface MultiFactorCreateSettings { - enrolledFactors: CreateMultiFactorInfoRequest[]; -} - -// @public -export abstract class MultiFactorInfo { - // (undocumented) - readonly displayName?: string; - // (undocumented) - readonly enrollmentTime?: string; - // (undocumented) - readonly factorId: string; - toJSON(): any; - // (undocumented) - readonly uid: string; -} - -// @public -export class MultiFactorSettings { - // (undocumented) - enrolledFactors: MultiFactorInfo[]; - toJSON(): any; -} - -// @public -export interface MultiFactorUpdateSettings { - enrolledFactors: UpdateMultiFactorInfoRequest[] | null; -} - -// @public -export interface OIDCAuthProviderConfig extends AuthProviderConfig { - clientId: string; - issuer: string; -} - -// @public -export interface OIDCUpdateAuthProviderRequest { - clientId?: string; - displayName?: string; - enabled?: boolean; - issuer?: string; -} - -export { OnDisconnect } - -// @public -export interface PhoneIdentifier { - // (undocumented) - phoneNumber: string; -} - -// @public -export class PhoneMultiFactorInfo extends MultiFactorInfo { - // (undocumented) - readonly phoneNumber: string; - toJSON(): any; -} - // @public export function projectManagement(app?: app.App): projectManagement.ProjectManagement; @@ -975,18 +815,6 @@ export namespace projectManagement { } } -// @public -export interface ProviderIdentifier { - // (undocumented) - providerId: string; - // (undocumented) - providerUid: string; -} - -export { Query } - -export { Reference } - // @public (undocumented) export function refreshToken(refreshTokenPathOrObject: string | object, httpAgent?: Agent): Credential; @@ -1073,26 +901,6 @@ export namespace remoteConfig { } } -// @public -export interface SAMLAuthProviderConfig extends AuthProviderConfig { - callbackURL?: string; - idpEntityId: string; - rpEntityId: string; - ssoURL: string; - x509Certificates: string[]; -} - -// @public -export interface SAMLUpdateAuthProviderRequest { - callbackURL?: string; - displayName?: string; - enabled?: boolean; - idpEntityId?: string; - rpEntityId?: string; - ssoURL?: string; - x509Certificates?: string[]; -} - // @public (undocumented) export const SDK_VERSION: string; @@ -1136,9 +944,6 @@ export namespace securityRules { } } -// @public (undocumented) -export const ServerValue: rtdb.ServerValue; - // @public (undocumented) export interface ServiceAccount { // (undocumented) @@ -1149,11 +954,6 @@ export interface ServiceAccount { projectId?: string; } -// @public -export interface SessionCookieOptions { - expiresIn: number; -} - // @public export function storage(app?: app.App): storage.Storage; @@ -1166,212 +966,6 @@ export namespace storage { } } -// @public -export class Tenant { - // (undocumented) - readonly displayName?: string; - // (undocumented) - get emailSignInConfig(): EmailSignInProviderConfig | undefined; - // (undocumented) - get multiFactorConfig(): MultiFactorConfig | undefined; - // (undocumented) - readonly tenantId: string; - // (undocumented) - readonly testPhoneNumbers?: { - [phoneNumber: string]: string; - }; - toJSON(): object; - } - -// @public -export class TenantAwareAuth extends BaseAuth { - createSessionCookie(idToken: string, sessionCookieOptions: SessionCookieOptions): Promise; - // (undocumented) - readonly tenantId: string; - verifyIdToken(idToken: string, checkRevoked?: boolean): Promise; - verifySessionCookie(sessionCookie: string, checkRevoked?: boolean): Promise; -} - -// @public -export class TenantManager { - authForTenant(tenantId: string): TenantAwareAuth; - createTenant(tenantOptions: CreateTenantRequest): Promise; - deleteTenant(tenantId: string): Promise; - getTenant(tenantId: string): Promise; - listTenants(maxResults?: number, pageToken?: string): Promise; - updateTenant(tenantId: string, tenantOptions: UpdateTenantRequest): Promise; -} - -export { ThenableReference } - -// @public -export interface UidIdentifier { - // (undocumented) - uid: string; -} - -// @public (undocumented) -export type UpdateAuthProviderRequest = SAMLUpdateAuthProviderRequest | OIDCUpdateAuthProviderRequest; - -// @public -export interface UpdateMultiFactorInfoRequest { - displayName?: string; - enrollmentTime?: string; - factorId: string; - uid?: string; -} - -// @public -export interface UpdatePhoneMultiFactorInfoRequest extends UpdateMultiFactorInfoRequest { - phoneNumber: string; -} - -// @public -export interface UpdateRequest { - disabled?: boolean; - displayName?: string | null; - email?: string; - emailVerified?: boolean; - multiFactor?: MultiFactorUpdateSettings; - password?: string; - phoneNumber?: string | null; - photoURL?: string | null; -} - -// @public -export interface UpdateTenantRequest { - displayName?: string; - emailSignInConfig?: EmailSignInProviderConfig; - multiFactorConfig?: MultiFactorConfig; - testPhoneNumbers?: { - [phoneNumber: string]: string; - } | null; -} - -// @public -export type UserIdentifier = UidIdentifier | EmailIdentifier | PhoneIdentifier | ProviderIdentifier; - -// @public -export interface UserImportOptions { - hash: { - algorithm: HashAlgorithmType; - key?: Buffer; - saltSeparator?: Buffer; - rounds?: number; - memoryCost?: number; - parallelization?: number; - blockSize?: number; - derivedKeyLength?: number; - }; -} - -// @public -export interface UserImportRecord { - customClaims?: { - [key: string]: any; - }; - disabled?: boolean; - displayName?: string; - email?: string; - emailVerified?: boolean; - metadata?: UserMetadataRequest; - multiFactor?: MultiFactorUpdateSettings; - passwordHash?: Buffer; - passwordSalt?: Buffer; - phoneNumber?: string; - photoURL?: string; - providerData?: UserProviderRequest[]; - tenantId?: string; - uid: string; -} - -// @public -export interface UserImportResult { - errors: FirebaseArrayIndexError[]; - failureCount: number; - successCount: number; -} - -// @public -export class UserInfo { - // (undocumented) - readonly displayName: string; - // (undocumented) - readonly email: string; - // (undocumented) - readonly phoneNumber: string; - // (undocumented) - readonly photoURL: string; - // (undocumented) - readonly providerId: string; - toJSON(): object; - // (undocumented) - readonly uid: string; -} - -// @public -export class UserMetadata { - // (undocumented) - readonly creationTime: string; - readonly lastRefreshTime: string | null; - // (undocumented) - readonly lastSignInTime: string; - toJSON(): object; -} - -// @public -export interface UserMetadataRequest { - creationTime?: string; - lastSignInTime?: string; -} - -// @public -export interface UserProviderRequest { - displayName?: string; - email?: string; - phoneNumber?: string; - photoURL?: string; - providerId: string; - uid: string; -} - -// @public -export class UserRecord { - // (undocumented) - readonly customClaims: { - [key: string]: any; - }; - // (undocumented) - readonly disabled: boolean; - // (undocumented) - readonly displayName: string; - // (undocumented) - readonly email: string; - // (undocumented) - readonly emailVerified: boolean; - // (undocumented) - readonly metadata: UserMetadata; - // (undocumented) - readonly multiFactor?: MultiFactorSettings; - // (undocumented) - readonly passwordHash?: string; - // (undocumented) - readonly passwordSalt?: string; - // (undocumented) - readonly phoneNumber: string; - // (undocumented) - readonly photoURL: string; - // (undocumented) - readonly providerData: UserInfo[]; - // (undocumented) - readonly tenantId?: string | null; - toJSON(): object; - // (undocumented) - readonly tokensValidAfterTime?: string; - // (undocumented) - readonly uid: string; -} - // (No @packageDocumentation comment for this package) diff --git a/etc/firebase-admin.app.api.md b/etc/firebase-admin.app.api.md new file mode 100644 index 0000000000..916a5091d2 --- /dev/null +++ b/etc/firebase-admin.app.api.md @@ -0,0 +1,76 @@ +## API Report File for "firebase-admin" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Agent } from 'http'; + +// @public (undocumented) +export interface App { + name: string; + options: AppOptions; +} + +// @public (undocumented) +export function applicationDefault(httpAgent?: Agent): Credential; + +// @public +export interface AppOptions { + credential?: Credential; + databaseAuthVariableOverride?: object | null; + databaseURL?: string; + httpAgent?: Agent; + projectId?: string; + serviceAccountId?: string; + storageBucket?: string; +} + +// @public (undocumented) +export function cert(serviceAccountPathOrObject: string | ServiceAccount, httpAgent?: Agent): Credential; + +// @public (undocumented) +export interface Credential { + getAccessToken(): Promise; +} + +// @public (undocumented) +export function deleteApp(app: App): Promise; + +// @public (undocumented) +export function getApp(name?: string): App; + +// @public (undocumented) +export function getApps(): App[]; + +// @public +export interface GoogleOAuthAccessToken { + // (undocumented) + access_token: string; + // (undocumented) + expires_in: number; +} + +// @public (undocumented) +export function initializeApp(options?: AppOptions, name?: string): App; + +// @public (undocumented) +export function refreshToken(refreshTokenPathOrObject: string | object, httpAgent?: Agent): Credential; + +// @public (undocumented) +export const SDK_VERSION: string; + +// @public (undocumented) +export interface ServiceAccount { + // (undocumented) + clientEmail?: string; + // (undocumented) + privateKey?: string; + // (undocumented) + projectId?: string; +} + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/etc/firebase-admin.auth.api.md b/etc/firebase-admin.auth.api.md new file mode 100644 index 0000000000..4f4f4d9417 --- /dev/null +++ b/etc/firebase-admin.auth.api.md @@ -0,0 +1,589 @@ +## API Report File for "firebase-admin" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Agent } from 'http'; + +// @public +export interface ActionCodeSettings { + android?: { + packageName: string; + installApp?: boolean; + minimumVersion?: string; + }; + dynamicLinkDomain?: string; + handleCodeInApp?: boolean; + iOS?: { + bundleId: string; + }; + url: string; +} + +// @public +export class Auth extends BaseAuth { + // Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts + get app(): App; + tenantManager(): TenantManager; + } + +// @public +export function auth(app?: App): auth.Auth; + +// @public (undocumented) +export namespace auth { + // (undocumented) + export type ActionCodeSettings = ActionCodeSettings; + // (undocumented) + export type Auth = Auth; + // (undocumented) + export type AuthFactorType = AuthFactorType; + // (undocumented) + export type AuthProviderConfig = AuthProviderConfig; + // (undocumented) + export type AuthProviderConfigFilter = AuthProviderConfigFilter; + // (undocumented) + export type BaseAuth = BaseAuth; + // (undocumented) + export type CreateMultiFactorInfoRequest = CreateMultiFactorInfoRequest; + // (undocumented) + export type CreatePhoneMultiFactorInfoRequest = CreatePhoneMultiFactorInfoRequest; + // (undocumented) + export type CreateRequest = CreateRequest; + // (undocumented) + export type CreateTenantRequest = CreateTenantRequest; + // (undocumented) + export type DecodedIdToken = DecodedIdToken; + // (undocumented) + export type DeleteUsersResult = DeleteUsersResult; + // (undocumented) + export type EmailIdentifier = EmailIdentifier; + // (undocumented) + export type EmailSignInProviderConfig = EmailSignInProviderConfig; + // (undocumented) + export type GetUsersResult = GetUsersResult; + // (undocumented) + export type HashAlgorithmType = HashAlgorithmType; + // (undocumented) + export type ListProviderConfigResults = ListProviderConfigResults; + // (undocumented) + export type ListTenantsResult = ListTenantsResult; + // (undocumented) + export type ListUsersResult = ListUsersResult; + // (undocumented) + export type MultiFactorConfig = MultiFactorConfig; + // (undocumented) + export type MultiFactorConfigState = MultiFactorConfigState; + // (undocumented) + export type MultiFactorCreateSettings = MultiFactorCreateSettings; + // (undocumented) + export type MultiFactorInfo = MultiFactorInfo; + // (undocumented) + export type MultiFactorSettings = MultiFactorSettings; + // (undocumented) + export type MultiFactorUpdateSettings = MultiFactorUpdateSettings; + // (undocumented) + export type OIDCAuthProviderConfig = OIDCAuthProviderConfig; + // (undocumented) + export type OIDCUpdateAuthProviderRequest = OIDCUpdateAuthProviderRequest; + // (undocumented) + export type PhoneIdentifier = PhoneIdentifier; + // (undocumented) + export type PhoneMultiFactorInfo = PhoneMultiFactorInfo; + // (undocumented) + export type ProviderIdentifier = ProviderIdentifier; + // (undocumented) + export type SAMLAuthProviderConfig = SAMLAuthProviderConfig; + // (undocumented) + export type SAMLUpdateAuthProviderRequest = SAMLUpdateAuthProviderRequest; + // (undocumented) + export type SessionCookieOptions = SessionCookieOptions; + // (undocumented) + export type Tenant = Tenant; + // (undocumented) + export type TenantAwareAuth = TenantAwareAuth; + // (undocumented) + export type TenantManager = TenantManager; + // (undocumented) + export type UidIdentifier = UidIdentifier; + // (undocumented) + export type UpdateAuthProviderRequest = UpdateAuthProviderRequest; + // (undocumented) + export type UpdateMultiFactorInfoRequest = UpdateMultiFactorInfoRequest; + // (undocumented) + export type UpdatePhoneMultiFactorInfoRequest = UpdatePhoneMultiFactorInfoRequest; + // (undocumented) + export type UpdateRequest = UpdateRequest; + // (undocumented) + export type UpdateTenantRequest = UpdateTenantRequest; + // (undocumented) + export type UserIdentifier = UserIdentifier; + // (undocumented) + export type UserImportOptions = UserImportOptions; + // (undocumented) + export type UserImportRecord = UserImportRecord; + // (undocumented) + export type UserImportResult = UserImportResult; + // (undocumented) + export type UserInfo = UserInfo; + // (undocumented) + export type UserMetadata = UserMetadata; + // (undocumented) + export type UserMetadataRequest = UserMetadataRequest; + // (undocumented) + export type UserProviderRequest = UserProviderRequest; + // (undocumented) + export type UserRecord = UserRecord; +} + +// @public +export type AuthFactorType = 'phone'; + +// @public +export interface AuthProviderConfig { + displayName?: string; + enabled: boolean; + providerId: string; +} + +// @public +export interface AuthProviderConfigFilter { + maxResults?: number; + pageToken?: string; + type: 'saml' | 'oidc'; +} + +// @public +export class BaseAuth { + createCustomToken(uid: string, developerClaims?: object): Promise; + createProviderConfig(config: AuthProviderConfig): Promise; + createSessionCookie(idToken: string, sessionCookieOptions: SessionCookieOptions): Promise; + createUser(properties: CreateRequest): Promise; + deleteProviderConfig(providerId: string): Promise; + deleteUser(uid: string): Promise; + // (undocumented) + deleteUsers(uids: string[]): Promise; + generateEmailVerificationLink(email: string, actionCodeSettings?: ActionCodeSettings): Promise; + generatePasswordResetLink(email: string, actionCodeSettings?: ActionCodeSettings): Promise; + generateSignInWithEmailLink(email: string, actionCodeSettings: ActionCodeSettings): Promise; + getProviderConfig(providerId: string): Promise; + getUser(uid: string): Promise; + getUserByEmail(email: string): Promise; + getUserByPhoneNumber(phoneNumber: string): Promise; + getUsers(identifiers: UserIdentifier[]): Promise; + importUsers(users: UserImportRecord[], options?: UserImportOptions): Promise; + listProviderConfigs(options: AuthProviderConfigFilter): Promise; + listUsers(maxResults?: number, pageToken?: string): Promise; + revokeRefreshTokens(uid: string): Promise; + setCustomUserClaims(uid: string, customUserClaims: object | null): Promise; + updateProviderConfig(providerId: string, updatedConfig: UpdateAuthProviderRequest): Promise; + updateUser(uid: string, properties: UpdateRequest): Promise; + verifyIdToken(idToken: string, checkRevoked?: boolean): Promise; + verifySessionCookie(sessionCookie: string, checkRevoked?: boolean): Promise; +} + +// @public +export interface CreateMultiFactorInfoRequest { + displayName?: string; + factorId: string; +} + +// @public +export interface CreatePhoneMultiFactorInfoRequest extends CreateMultiFactorInfoRequest { + phoneNumber: string; +} + +// @public +export interface CreateRequest extends UpdateRequest { + multiFactor?: MultiFactorCreateSettings; + uid?: string; +} + +// @public +export type CreateTenantRequest = UpdateTenantRequest; + +// @public +export interface DecodedIdToken { + // (undocumented) + [key: string]: any; + aud: string; + auth_time: number; + email?: string; + email_verified?: boolean; + exp: number; + firebase: { + identities: { + [key: string]: any; + }; + sign_in_provider: string; + sign_in_second_factor?: string; + second_factor_identifier?: string; + tenant?: string; + [key: string]: any; + }; + iat: number; + iss: string; + phone_number?: string; + picture?: string; + sub: string; + uid: string; +} + +// @public +export interface DeleteUsersResult { + // Warning: (ae-forgotten-export) The symbol "FirebaseArrayIndexError" needs to be exported by the entry point index.d.ts + errors: FirebaseArrayIndexError[]; + failureCount: number; + successCount: number; +} + +// @public +export interface EmailIdentifier { + // (undocumented) + email: string; +} + +// @public +export interface EmailSignInProviderConfig { + enabled: boolean; + passwordRequired?: boolean; +} + +// @public (undocumented) +export function getAuth(app?: App): Auth; + +// @public +export interface GetUsersResult { + notFound: UserIdentifier[]; + users: UserRecord[]; +} + +// @public (undocumented) +export type HashAlgorithmType = 'SCRYPT' | 'STANDARD_SCRYPT' | 'HMAC_SHA512' | 'HMAC_SHA256' | 'HMAC_SHA1' | 'HMAC_MD5' | 'MD5' | 'PBKDF_SHA1' | 'BCRYPT' | 'PBKDF2_SHA256' | 'SHA512' | 'SHA256' | 'SHA1'; + +// @public +export interface ListProviderConfigResults { + pageToken?: string; + providerConfigs: AuthProviderConfig[]; +} + +// @public +export interface ListTenantsResult { + pageToken?: string; + tenants: Tenant[]; +} + +// @public +export interface ListUsersResult { + pageToken?: string; + users: UserRecord[]; +} + +// @public (undocumented) +export interface MultiFactorConfig { + factorIds?: AuthFactorType[]; + state: MultiFactorConfigState; +} + +// @public +export type MultiFactorConfigState = 'ENABLED' | 'DISABLED'; + +// @public +export interface MultiFactorCreateSettings { + enrolledFactors: CreateMultiFactorInfoRequest[]; +} + +// @public +export abstract class MultiFactorInfo { + // (undocumented) + readonly displayName?: string; + // (undocumented) + readonly enrollmentTime?: string; + // (undocumented) + readonly factorId: string; + toJSON(): any; + // (undocumented) + readonly uid: string; +} + +// @public +export class MultiFactorSettings { + // (undocumented) + enrolledFactors: MultiFactorInfo[]; + toJSON(): any; +} + +// @public +export interface MultiFactorUpdateSettings { + enrolledFactors: UpdateMultiFactorInfoRequest[] | null; +} + +// @public +export interface OIDCAuthProviderConfig extends AuthProviderConfig { + clientId: string; + issuer: string; +} + +// @public +export interface OIDCUpdateAuthProviderRequest { + clientId?: string; + displayName?: string; + enabled?: boolean; + issuer?: string; +} + +// @public +export interface PhoneIdentifier { + // (undocumented) + phoneNumber: string; +} + +// @public +export class PhoneMultiFactorInfo extends MultiFactorInfo { + // (undocumented) + readonly phoneNumber: string; + toJSON(): any; +} + +// @public +export interface ProviderIdentifier { + // (undocumented) + providerId: string; + // (undocumented) + providerUid: string; +} + +// @public +export interface SAMLAuthProviderConfig extends AuthProviderConfig { + callbackURL?: string; + idpEntityId: string; + rpEntityId: string; + ssoURL: string; + x509Certificates: string[]; +} + +// @public +export interface SAMLUpdateAuthProviderRequest { + callbackURL?: string; + displayName?: string; + enabled?: boolean; + idpEntityId?: string; + rpEntityId?: string; + ssoURL?: string; + x509Certificates?: string[]; +} + +// @public +export interface SessionCookieOptions { + expiresIn: number; +} + +// @public +export class Tenant { + // (undocumented) + readonly displayName?: string; + // (undocumented) + get emailSignInConfig(): EmailSignInProviderConfig | undefined; + // (undocumented) + get multiFactorConfig(): MultiFactorConfig | undefined; + // (undocumented) + readonly tenantId: string; + // (undocumented) + readonly testPhoneNumbers?: { + [phoneNumber: string]: string; + }; + toJSON(): object; + } + +// @public +export class TenantAwareAuth extends BaseAuth { + createSessionCookie(idToken: string, sessionCookieOptions: SessionCookieOptions): Promise; + // (undocumented) + readonly tenantId: string; + verifyIdToken(idToken: string, checkRevoked?: boolean): Promise; + verifySessionCookie(sessionCookie: string, checkRevoked?: boolean): Promise; +} + +// @public +export class TenantManager { + authForTenant(tenantId: string): TenantAwareAuth; + createTenant(tenantOptions: CreateTenantRequest): Promise; + deleteTenant(tenantId: string): Promise; + getTenant(tenantId: string): Promise; + listTenants(maxResults?: number, pageToken?: string): Promise; + updateTenant(tenantId: string, tenantOptions: UpdateTenantRequest): Promise; +} + +// @public +export interface UidIdentifier { + // (undocumented) + uid: string; +} + +// @public (undocumented) +export type UpdateAuthProviderRequest = SAMLUpdateAuthProviderRequest | OIDCUpdateAuthProviderRequest; + +// @public +export interface UpdateMultiFactorInfoRequest { + displayName?: string; + enrollmentTime?: string; + factorId: string; + uid?: string; +} + +// @public +export interface UpdatePhoneMultiFactorInfoRequest extends UpdateMultiFactorInfoRequest { + phoneNumber: string; +} + +// @public +export interface UpdateRequest { + disabled?: boolean; + displayName?: string | null; + email?: string; + emailVerified?: boolean; + multiFactor?: MultiFactorUpdateSettings; + password?: string; + phoneNumber?: string | null; + photoURL?: string | null; +} + +// @public +export interface UpdateTenantRequest { + displayName?: string; + emailSignInConfig?: EmailSignInProviderConfig; + multiFactorConfig?: MultiFactorConfig; + testPhoneNumbers?: { + [phoneNumber: string]: string; + } | null; +} + +// @public +export type UserIdentifier = UidIdentifier | EmailIdentifier | PhoneIdentifier | ProviderIdentifier; + +// @public +export interface UserImportOptions { + hash: { + algorithm: HashAlgorithmType; + key?: Buffer; + saltSeparator?: Buffer; + rounds?: number; + memoryCost?: number; + parallelization?: number; + blockSize?: number; + derivedKeyLength?: number; + }; +} + +// @public +export interface UserImportRecord { + customClaims?: { + [key: string]: any; + }; + disabled?: boolean; + displayName?: string; + email?: string; + emailVerified?: boolean; + metadata?: UserMetadataRequest; + multiFactor?: MultiFactorUpdateSettings; + passwordHash?: Buffer; + passwordSalt?: Buffer; + phoneNumber?: string; + photoURL?: string; + providerData?: UserProviderRequest[]; + tenantId?: string; + uid: string; +} + +// @public +export interface UserImportResult { + errors: FirebaseArrayIndexError[]; + failureCount: number; + successCount: number; +} + +// @public +export class UserInfo { + // (undocumented) + readonly displayName: string; + // (undocumented) + readonly email: string; + // (undocumented) + readonly phoneNumber: string; + // (undocumented) + readonly photoURL: string; + // (undocumented) + readonly providerId: string; + toJSON(): object; + // (undocumented) + readonly uid: string; +} + +// @public +export class UserMetadata { + // (undocumented) + readonly creationTime: string; + readonly lastRefreshTime: string | null; + // (undocumented) + readonly lastSignInTime: string; + toJSON(): object; +} + +// @public +export interface UserMetadataRequest { + creationTime?: string; + lastSignInTime?: string; +} + +// @public +export interface UserProviderRequest { + displayName?: string; + email?: string; + phoneNumber?: string; + photoURL?: string; + providerId: string; + uid: string; +} + +// @public +export class UserRecord { + // (undocumented) + readonly customClaims: { + [key: string]: any; + }; + // (undocumented) + readonly disabled: boolean; + // (undocumented) + readonly displayName: string; + // (undocumented) + readonly email: string; + // (undocumented) + readonly emailVerified: boolean; + // (undocumented) + readonly metadata: UserMetadata; + // (undocumented) + readonly multiFactor?: MultiFactorSettings; + // (undocumented) + readonly passwordHash?: string; + // (undocumented) + readonly passwordSalt?: string; + // (undocumented) + readonly phoneNumber: string; + // (undocumented) + readonly photoURL: string; + // (undocumented) + readonly providerData: UserInfo[]; + // (undocumented) + readonly tenantId?: string | null; + toJSON(): object; + // (undocumented) + readonly tokensValidAfterTime?: string; + // (undocumented) + readonly uid: string; +} + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/etc/firebase-admin.database.api.md b/etc/firebase-admin.database.api.md new file mode 100644 index 0000000000..886e6ca9ba --- /dev/null +++ b/etc/firebase-admin.database.api.md @@ -0,0 +1,77 @@ +## API Report File for "firebase-admin" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Agent } from 'http'; +import { DataSnapshot } from '@firebase/database-types'; +import { EventType } from '@firebase/database-types'; +import { FirebaseDatabase } from '@firebase/database-types'; +import { OnDisconnect } from '@firebase/database-types'; +import { Query } from '@firebase/database-types'; +import { Reference } from '@firebase/database-types'; +import * as rtdb from '@firebase/database-types'; +import { ThenableReference } from '@firebase/database-types'; + +// @public (undocumented) +export interface Database extends FirebaseDatabase { + getRules(): Promise; + getRulesJSON(): Promise; + setRules(source: string | Buffer | object): Promise; +} + +// Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts +// +// @public +export function database(app?: App): database.Database; + +// @public (undocumented) +export namespace database { + // (undocumented) + export type Database = Database; + // (undocumented) + export type DataSnapshot = rtdb.DataSnapshot; + // (undocumented) + export type EventType = rtdb.EventType; + // (undocumented) + export type OnDisconnect = rtdb.OnDisconnect; + // (undocumented) + export type Query = rtdb.Query; + // (undocumented) + export type Reference = rtdb.Reference; + // (undocumented) + export type ThenableReference = rtdb.ThenableReference; + const // (undocumented) + enableLogging: typeof rtdb.enableLogging; + const ServerValue: rtdb.ServerValue; +} + +export { DataSnapshot } + +// @public (undocumented) +export const enableLogging: typeof rtdb.enableLogging; + +export { EventType } + +// @public (undocumented) +export function getDatabase(app?: App): Database; + +// @public (undocumented) +export function getDatabaseWithUrl(url: string, app?: App): Database; + +export { OnDisconnect } + +export { Query } + +export { Reference } + +// @public (undocumented) +export const ServerValue: rtdb.ServerValue; + +export { ThenableReference } + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/etc/firebase-admin.instance-id.api.md b/etc/firebase-admin.instance-id.api.md new file mode 100644 index 0000000000..a2d591f6f3 --- /dev/null +++ b/etc/firebase-admin.instance-id.api.md @@ -0,0 +1,32 @@ +## API Report File for "firebase-admin" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Agent } from 'http'; + +// Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export function getInstanceId(app?: App): InstanceId; + +// @public +export class InstanceId { + get app(): App; + deleteInstanceId(instanceId: string): Promise; + } + +// @public +export function instanceId(app?: App): instanceId.InstanceId; + +// @public (undocumented) +export namespace instanceId { + // (undocumented) + export type InstanceId = InstanceId; +} + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/generate-reports.js b/generate-reports.js new file mode 100644 index 0000000000..0f7329498c --- /dev/null +++ b/generate-reports.js @@ -0,0 +1,90 @@ +/** + * @license + * Copyright 2021 Google Inc. + * + * 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-promise'); +const fs = require('mz/fs'); +const yargs = require('yargs'); + +const { local: localMode } = yargs + .option('local', { + boolean: true, + description: 'Run API Extractor with --local flag', + }) + .version(false) + .help().argv; + +// API Extractor configuration file. +const config = require('./api-extractor.json'); + +// List of module entry points. We generate a separate report for each entry point. +const entryPoints = { + 'firebase-admin': './lib/default-namespace.d.ts', + 'firebase-admin/app': './lib/app/index.d.ts', + 'firebase-admin/auth': './lib/auth/index.d.ts', + 'firebase-admin/database': './lib/database/index.d.ts', + 'firebase-admin/instance-id': './lib/instance-id/index.d.ts', +}; + +const apiExtractorBin = './node_modules/.bin/api-extractor run'; + +const tempConfigFile = 'api-extractor.tmp'; + +async function generateReports() { + for (const key in entryPoints) { + await generateReportForEntryPoint(key); + } +} + +async function generateReportForEntryPoint(key) { + console.log(`Generating API report for ${key}`) + console.log('========================================================\n'); + + console.log('Updating configuration for entry point...'); + config.apiReport.reportFileName = `${key.replace('/', '.')}.api.md`; + config.mainEntryPointFilePath = entryPoints[key]; + console.log(`Report file name: ${config.apiReport.reportFileName}`); + console.log(`Entry point declaration: ${config.mainEntryPointFilePath}`); + await fs.writeFile(tempConfigFile, JSON.stringify(config)); + + let command = `${apiExtractorBin} -c ${tempConfigFile}`; + if (localMode) { + command += ' --local'; + } + + console.log(`Running command: ${command}`); + try { + const output = await exec(command); + console.log(output.stdout); + } catch (err) { + if (err.stdout) { + console.log(err.stdout); + } + + throw err.stderr; + } finally { + await fs.unlink(tempConfigFile); + } +} + +(async () => { + try { + await generateReports(); + } catch (err) { + console.log(err); + process.exit(1); + } +})(); diff --git a/package.json b/package.json index 21b22b48a4..1285586261 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,8 @@ "lint:src": "eslint src/ --ext .ts", "lint:test": "eslint test/ --ext .ts", "apidocs": "node docgen/generate-docs.js --api node", - "api-extractor": "api-extractor run", - "api-extractor:local": "npm run build && api-extractor run --local" + "api-extractor": "node generate-reports.js", + "api-extractor:local": "npm run build && node generate-reports.js --local" }, "nyc": { "extension": [ diff --git a/src/default-namespace.d.ts b/src/default-namespace.d.ts index 3de06b1bbb..188f904275 100644 --- a/src/default-namespace.d.ts +++ b/src/default-namespace.d.ts @@ -16,13 +16,13 @@ export * from './credential/index'; export * from './firebase-namespace-api'; -export * from './auth/index'; -export * from './database/index'; -export * from './firestore/index'; -export * from './instance-id/index'; -export * from './machine-learning/index'; -export * from './messaging/index'; -export * from './project-management/index'; -export * from './remote-config/index'; -export * from './security-rules/index'; -export * from './storage/index'; +export { auth } from './auth/index'; +export { database } from './database/index'; +export { firestore } from './firestore/index'; +export { instanceId } from './instance-id/index'; +export { machineLearning } from './machine-learning/index'; +export { messaging } from './messaging/index'; +export { projectManagement } from './project-management/index'; +export { remoteConfig } from './remote-config/index'; +export { securityRules } from './security-rules/index'; +export { storage } from './storage/index'; From 3e6d70a0f60c8e402659dd16c149fa153ce6693a Mon Sep 17 00:00:00 2001 From: Hiranya Jayathilaka Date: Wed, 27 Jan 2021 17:10:27 -0800 Subject: [PATCH 2/2] fix: Using api-extractor library to generate reports --- api-extractor.json | 2 +- etc/firebase-admin.app.api.md | 2 +- etc/firebase-admin.auth.api.md | 2 +- etc/firebase-admin.database.api.md | 2 +- etc/firebase-admin.instance-id.api.md | 2 +- generate-reports.js | 39 +++++++++++++++------------ 6 files changed, 27 insertions(+), 22 deletions(-) diff --git a/api-extractor.json b/api-extractor.json index 44a05957d6..43ef780464 100644 --- a/api-extractor.json +++ b/api-extractor.json @@ -16,7 +16,7 @@ "enabled": false }, "tsdocMetadata": { - + "enabled": false }, "messages": { "compilerMessageReporting": { diff --git a/etc/firebase-admin.app.api.md b/etc/firebase-admin.app.api.md index 916a5091d2..96c5a4ea55 100644 --- a/etc/firebase-admin.app.api.md +++ b/etc/firebase-admin.app.api.md @@ -1,4 +1,4 @@ -## API Report File for "firebase-admin" +## API Report File for "firebase-admin.app" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). diff --git a/etc/firebase-admin.auth.api.md b/etc/firebase-admin.auth.api.md index 4f4f4d9417..7e10a8a3f1 100644 --- a/etc/firebase-admin.auth.api.md +++ b/etc/firebase-admin.auth.api.md @@ -1,4 +1,4 @@ -## API Report File for "firebase-admin" +## API Report File for "firebase-admin.auth" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). diff --git a/etc/firebase-admin.database.api.md b/etc/firebase-admin.database.api.md index 886e6ca9ba..0b8c5b0790 100644 --- a/etc/firebase-admin.database.api.md +++ b/etc/firebase-admin.database.api.md @@ -1,4 +1,4 @@ -## API Report File for "firebase-admin" +## API Report File for "firebase-admin.database" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). diff --git a/etc/firebase-admin.instance-id.api.md b/etc/firebase-admin.instance-id.api.md index a2d591f6f3..f5929e7efc 100644 --- a/etc/firebase-admin.instance-id.api.md +++ b/etc/firebase-admin.instance-id.api.md @@ -1,4 +1,4 @@ -## API Report File for "firebase-admin" +## API Report File for "firebase-admin.instance-id" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). diff --git a/generate-reports.js b/generate-reports.js index 0f7329498c..b5325f1e9e 100644 --- a/generate-reports.js +++ b/generate-reports.js @@ -15,9 +15,10 @@ * limitations under the License. */ -const { exec } = require('child-process-promise'); +const path = require('path'); const fs = require('mz/fs'); const yargs = require('yargs'); +const { Extractor, ExtractorConfig } = require('@microsoft/api-extractor'); const { local: localMode } = yargs .option('local', { @@ -39,8 +40,6 @@ const entryPoints = { 'firebase-admin/instance-id': './lib/instance-id/index.d.ts', }; -const apiExtractorBin = './node_modules/.bin/api-extractor run'; - const tempConfigFile = 'api-extractor.tmp'; async function generateReports() { @@ -50,31 +49,37 @@ async function generateReports() { } async function generateReportForEntryPoint(key) { - console.log(`Generating API report for ${key}`) + console.log(`\nGenerating API report for ${key}`) console.log('========================================================\n'); + const safeName = key.replace('/', '.'); console.log('Updating configuration for entry point...'); - config.apiReport.reportFileName = `${key.replace('/', '.')}.api.md`; + config.apiReport.reportFileName = `${safeName}.api.md`; config.mainEntryPointFilePath = entryPoints[key]; console.log(`Report file name: ${config.apiReport.reportFileName}`); console.log(`Entry point declaration: ${config.mainEntryPointFilePath}`); await fs.writeFile(tempConfigFile, JSON.stringify(config)); - let command = `${apiExtractorBin} -c ${tempConfigFile}`; - if (localMode) { - command += ' --local'; - } - - console.log(`Running command: ${command}`); try { - const output = await exec(command); - console.log(output.stdout); - } catch (err) { - if (err.stdout) { - console.log(err.stdout); + const configFile = ExtractorConfig.loadFile(tempConfigFile); + const extractorConfig = ExtractorConfig.prepare({ + configObject: configFile, + configObjectFullPath: path.resolve(tempConfigFile), + packageJson: { + name: safeName, + }, + packageJsonFullPath: path.resolve('package.json'), + }); + const extractorResult = Extractor.invoke(extractorConfig, { + localBuild: localMode, + showVerboseMessages: true + }); + if (!extractorResult.succeeded) { + throw new Error(`API Extractor completed with ${extractorResult.errorCount} errors` + + ` and ${extractorResult.warningCount} warnings`); } - throw err.stderr; + console.error(`API Extractor completed successfully`); } finally { await fs.unlink(tempConfigFile); }