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