1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | import { App } from '../app/index';
|
19 | import { UserImportOptions, UserImportRecord, UserImportResult } from './user-import-builder';
|
20 | import { TenantServerResponse, CreateTenantRequest, UpdateTenantRequest } from './tenant';
|
21 | import { ProjectConfigServerResponse, UpdateProjectConfigRequest } from './project-config';
|
22 |
|
23 | export declare const RESERVED_CLAIMS: string[];
|
24 |
|
25 | export declare const EMAIL_ACTION_REQUEST_TYPES: string[];
|
26 |
|
27 | declare class AuthResourceUrlBuilder {
|
28 | protected app: App;
|
29 | protected version: string;
|
30 | protected urlFormat: string;
|
31 | private projectId;
|
32 | |
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | constructor(app: App, version?: string);
|
40 | /**
|
41 | * Returns the resource URL corresponding to the provided parameters.
|
42 | *
|
43 | * @param api - The backend API name.
|
44 | * @param params - The optional additional parameters to substitute in the
|
45 | * URL path.
|
46 | * @returns The corresponding resource URL.
|
47 | */
|
48 | getUrl(api?: string, params?: object): Promise<string>;
|
49 | private getProjectId;
|
50 | }
|
51 | interface BatchDeleteErrorInfo {
|
52 | index?: number;
|
53 | localId?: string;
|
54 | message?: string;
|
55 | }
|
56 | export interface BatchDeleteAccountsResponse {
|
57 | errors?: BatchDeleteErrorInfo[];
|
58 | }
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | export declare class AuthRequestHandler extends AbstractAuthRequestHandler {
|
65 | protected readonly authResourceUrlBuilder: AuthResourceUrlBuilder;
|
66 | |
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 | constructor(app: App);
|
73 | /**
|
74 | * @returns A new Auth user management resource URL builder instance.
|
75 | */
|
76 | protected newAuthUrlBuilder(): AuthResourceUrlBuilder;
|
77 | /**
|
78 | * @returns A new project config resource URL builder instance.
|
79 | */
|
80 | protected newProjectConfigUrlBuilder(): AuthResourceUrlBuilder;
|
81 | /**
|
82 | * Get the current project's config
|
83 | * @returns A promise that resolves with the project config information.
|
84 | */
|
85 | getProjectConfig(): Promise<ProjectConfigServerResponse>;
|
86 | /**
|
87 | * Update the current project's config.
|
88 | * @returns A promise that resolves with the project config information.
|
89 | */
|
90 | updateProjectConfig(options: UpdateProjectConfigRequest): Promise<ProjectConfigServerResponse>;
|
91 | /**
|
92 | * Looks up a tenant by tenant ID.
|
93 | *
|
94 | * @param tenantId - The tenant identifier of the tenant to lookup.
|
95 | * @returns A promise that resolves with the tenant information.
|
96 | */
|
97 | getTenant(tenantId: string): Promise<TenantServerResponse>;
|
98 | /**
|
99 | * Exports the tenants (single batch only) with a size of maxResults and starting from
|
100 | * the offset as specified by pageToken.
|
101 | *
|
102 | * @param maxResults - The page size, 1000 if undefined. This is also the maximum
|
103 | * allowed limit.
|
104 | * @param pageToken - The next page token. If not specified, returns tenants starting
|
105 | * without any offset. Tenants are returned in the order they were created from oldest to
|
106 | * newest, relative to the page token offset.
|
107 | * @returns A promise that resolves with the current batch of downloaded
|
108 | * tenants and the next page token if available. For the last page, an empty list of tenants
|
109 | * and no page token are returned.
|
110 | */
|
111 | listTenants(maxResults?: number, pageToken?: string): Promise<{
|
112 | tenants: TenantServerResponse[];
|
113 | nextPageToken?: string;
|
114 | }>;
|
115 | |
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 | deleteTenant(tenantId: string): Promise<void>;
|
122 | |
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 | createTenant(tenantOptions: CreateTenantRequest): Promise<TenantServerResponse>;
|
129 | |
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 | updateTenant(tenantId: string, tenantOptions: UpdateTenantRequest): Promise<TenantServerResponse>;
|
137 | }
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 | export declare class TenantAwareAuthRequestHandler extends AbstractAuthRequestHandler {
|
144 | private readonly tenantId;
|
145 | |
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 | constructor(app: App, tenantId: string);
|
154 | /**
|
155 | * @returns A new Auth user management resource URL builder instance.
|
156 | */
|
157 | protected newAuthUrlBuilder(): AuthResourceUrlBuilder;
|
158 | /**
|
159 | * @returns A new project config resource URL builder instance.
|
160 | */
|
161 | protected newProjectConfigUrlBuilder(): AuthResourceUrlBuilder;
|
162 | /**
|
163 | * Imports the list of users provided to Firebase Auth. This is useful when
|
164 | * migrating from an external authentication system without having to use the Firebase CLI SDK.
|
165 | * At most, 1000 users are allowed to be imported one at a time.
|
166 | * When importing a list of password users, UserImportOptions are required to be specified.
|
167 | *
|
168 | * Overrides the superclass methods by adding an additional check to match tenant IDs of
|
169 | * imported user records if present.
|
170 | *
|
171 | * @param users - The list of user records to import to Firebase Auth.
|
172 | * @param options - The user import options, required when the users provided
|
173 | * include password credentials.
|
174 | * @returns A promise that resolves when the operation completes
|
175 | * with the result of the import. This includes the number of successful imports, the number
|
176 | * of failed uploads and their corresponding errors.
|
177 | */
|
178 | uploadAccount(users: UserImportRecord[], options?: UserImportOptions): Promise<UserImportResult>;
|
179 | }
|
180 | /**
|
181 | * When true the SDK should communicate with the Auth Emulator for all API
|
182 | * calls and also produce unsigned tokens.
|
183 | */
|
184 | export declare function useEmulator(): boolean;
|
185 | export {};
|