@koolbase/core 12.43.0 → 12.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-admin.d.ts +55 -0
- package/dist/cjs/app-admin.js +107 -0
- package/dist/cjs/auth-errors.d.ts +32 -0
- package/dist/cjs/auth-errors.js +69 -0
- package/dist/cjs/auth.d.ts +22 -0
- package/dist/cjs/auth.js +107 -9
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/types.d.ts +74 -0
- package/dist/esm/app-admin.d.ts +55 -0
- package/dist/esm/app-admin.js +103 -0
- package/dist/esm/auth-errors.d.ts +32 -0
- package/dist/esm/auth-errors.js +61 -0
- package/dist/esm/auth.d.ts +22 -0
- package/dist/esm/auth.js +108 -10
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/types.d.ts +74 -0
- package/package.json +1 -1
package/dist/esm/types.d.ts
CHANGED
|
@@ -170,6 +170,45 @@ export interface KoolbaseAuditPage {
|
|
|
170
170
|
limit: number;
|
|
171
171
|
offset: number;
|
|
172
172
|
}
|
|
173
|
+
/** One person in the app, as an app admin sees them. */
|
|
174
|
+
export interface KoolbaseMember {
|
|
175
|
+
id: string;
|
|
176
|
+
email: string;
|
|
177
|
+
fullName?: string;
|
|
178
|
+
avatarUrl?: string;
|
|
179
|
+
/** `invited` has not signed in yet. */
|
|
180
|
+
status: 'active' | 'invited' | 'disabled';
|
|
181
|
+
/** An app admin: only the project owner can disable them or change their roles. */
|
|
182
|
+
isAdmin: boolean;
|
|
183
|
+
/** The claims the project marked as ones app admins can give. Others are never sent. */
|
|
184
|
+
roles: Record<string, unknown>;
|
|
185
|
+
/** Pass back to `admin.setRoles` as `expectedVersion`. */
|
|
186
|
+
version: number;
|
|
187
|
+
joinedAt: string;
|
|
188
|
+
lastSeenAt?: string;
|
|
189
|
+
}
|
|
190
|
+
/** A page of members, with the total across all pages. */
|
|
191
|
+
export interface KoolbaseMemberPage {
|
|
192
|
+
members: KoolbaseMember[];
|
|
193
|
+
total: number;
|
|
194
|
+
}
|
|
195
|
+
/** A role an app admin may give, with how many people hold it. */
|
|
196
|
+
export interface KoolbaseAssignableRole {
|
|
197
|
+
key: string;
|
|
198
|
+
valueType: string;
|
|
199
|
+
/** The only values allowed, when the project limited them; empty otherwise. */
|
|
200
|
+
allowedValues: string[];
|
|
201
|
+
description?: string;
|
|
202
|
+
holders: number;
|
|
203
|
+
/** For each value, how many people hold it. */
|
|
204
|
+
values: Record<string, number>;
|
|
205
|
+
}
|
|
206
|
+
/** What `admin.setRoles` leaves: the roles now, and the version to pass next time. */
|
|
207
|
+
export interface KoolbaseMemberRoles {
|
|
208
|
+
id: string;
|
|
209
|
+
roles: Record<string, unknown>;
|
|
210
|
+
version: number;
|
|
211
|
+
}
|
|
173
212
|
export interface ResendVerificationResult {
|
|
174
213
|
alreadyVerified: boolean;
|
|
175
214
|
/** When the link in the email stops working. Null when nothing was sent. */
|
|
@@ -181,6 +220,13 @@ export interface KoolbaseAuthStorage {
|
|
|
181
220
|
saveSession(session: KoolbaseSession): Promise<void>;
|
|
182
221
|
readSession(): Promise<KoolbaseSession | null>;
|
|
183
222
|
clear(): Promise<void>;
|
|
223
|
+
/**
|
|
224
|
+
* Remember me: where the next sign-in's session lives, told before it is
|
|
225
|
+
* saved. `true`: as long as the storage keeps anything; `false`: until the
|
|
226
|
+
* tab or browser closes. Optional -- a storage without it (a keychain, the
|
|
227
|
+
* memory one, an app's own) keeps every session as it always has.
|
|
228
|
+
*/
|
|
229
|
+
setRemember?(remember: boolean): Promise<void>;
|
|
184
230
|
}
|
|
185
231
|
/**
|
|
186
232
|
* Result of KoolbaseAuth.restoreSession(). Apps should branch on this:
|
|
@@ -225,6 +271,13 @@ export interface RegisterParams {
|
|
|
225
271
|
export interface LoginParams {
|
|
226
272
|
email: string;
|
|
227
273
|
password: string;
|
|
274
|
+
/**
|
|
275
|
+
* Whether this sign-in outlasts the browser (Remember me). Omitted: it
|
|
276
|
+
* does, as always. `false`: the session is kept for this tab only, and
|
|
277
|
+
* ends when it closes -- where the storage can tell the two apart (the
|
|
278
|
+
* browser's, in @koolbase/js; a keychain always keeps it).
|
|
279
|
+
*/
|
|
280
|
+
remember?: boolean;
|
|
228
281
|
}
|
|
229
282
|
export interface SendOtpParams {
|
|
230
283
|
phoneNumber: string;
|
|
@@ -232,6 +285,13 @@ export interface SendOtpParams {
|
|
|
232
285
|
export interface VerifyOtpParams {
|
|
233
286
|
phoneNumber: string;
|
|
234
287
|
code: string;
|
|
288
|
+
/**
|
|
289
|
+
* Whether this sign-in outlasts the browser (Remember me). Omitted: it
|
|
290
|
+
* does, as always. `false`: the session is kept for this tab only, and
|
|
291
|
+
* ends when it closes -- where the storage can tell the two apart (the
|
|
292
|
+
* browser's, in @koolbase/js; a keychain always keeps it).
|
|
293
|
+
*/
|
|
294
|
+
remember?: boolean;
|
|
235
295
|
}
|
|
236
296
|
export interface LinkPhoneParams {
|
|
237
297
|
phoneNumber: string;
|
|
@@ -609,6 +669,13 @@ export interface AppleFullName {
|
|
|
609
669
|
export interface SignInWithAppleParams {
|
|
610
670
|
identityToken: string;
|
|
611
671
|
nonce?: string;
|
|
672
|
+
/**
|
|
673
|
+
* Whether this sign-in outlasts the browser (Remember me). Omitted: it
|
|
674
|
+
* does, as always. `false`: the session is kept for this tab only, and
|
|
675
|
+
* ends when it closes -- where the storage can tell the two apart (the
|
|
676
|
+
* browser's, in @koolbase/js; a keychain always keeps it).
|
|
677
|
+
*/
|
|
678
|
+
remember?: boolean;
|
|
612
679
|
fullName?: AppleFullName;
|
|
613
680
|
/** The credential's authorization code: the server exchanges it for the
|
|
614
681
|
* token it revokes when the account is deleted, as Apple asks. */
|
|
@@ -627,6 +694,13 @@ export interface SignInWithAppleParams {
|
|
|
627
694
|
export interface SignInWithGoogleParams {
|
|
628
695
|
idToken: string;
|
|
629
696
|
nonce?: string;
|
|
697
|
+
/**
|
|
698
|
+
* Whether this sign-in outlasts the browser (Remember me). Omitted: it
|
|
699
|
+
* does, as always. `false`: the session is kept for this tab only, and
|
|
700
|
+
* ends when it closes -- where the storage can tell the two apart (the
|
|
701
|
+
* browser's, in @koolbase/js; a keychain always keeps it).
|
|
702
|
+
*/
|
|
703
|
+
remember?: boolean;
|
|
630
704
|
}
|
|
631
705
|
export type BatchOp = {
|
|
632
706
|
type: 'insert';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koolbase/core",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.45.0",
|
|
4
4
|
"description": "Koolbase SDK core \u2014 shared behaviour behind @koolbase/react-native and @koolbase/js. Install one of those, not this.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"types": "./dist/esm/index.d.ts",
|