@rebasepro/types 0.35.1 → 0.36.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/controllers/client.d.ts +6 -3
- package/dist/index.es.js +11 -1
- package/dist/index.es.js.map +1 -1
- package/dist/types/backend.d.ts +31 -0
- package/dist/users/import.d.ts +42 -3
- package/package.json +6 -3
package/dist/types/backend.d.ts
CHANGED
|
@@ -577,6 +577,37 @@ export interface SqlScriptResult {
|
|
|
577
577
|
* statement as the connection owner, who is named here instead.
|
|
578
578
|
*/
|
|
579
579
|
effectiveRole?: string;
|
|
580
|
+
/**
|
|
581
|
+
* Every statement of the script, in order, the last one included — the
|
|
582
|
+
* same statement the fields above describe. Absent when the transport
|
|
583
|
+
* cannot tell the statements apart (an in-process database, a server
|
|
584
|
+
* that does not report them).
|
|
585
|
+
*
|
|
586
|
+
* One row budget covers the whole script: when the statements together
|
|
587
|
+
* return more than a run keeps, the earlier statements give up their last
|
|
588
|
+
* rows first, so the last statement keeps as many as it would alone. A
|
|
589
|
+
* statement that gave rows up says so with {@link SqlStatementResult.truncated}.
|
|
590
|
+
*/
|
|
591
|
+
statements?: SqlStatementResult[];
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* One statement of a script — see {@link SqlScriptResult.statements}.
|
|
595
|
+
*
|
|
596
|
+
* @group Admin
|
|
597
|
+
*/
|
|
598
|
+
export interface SqlStatementResult {
|
|
599
|
+
/** Its rows, every value as the database's text; see {@link SqlScriptResult.rows}. */
|
|
600
|
+
rows: Record<string, string | null>[];
|
|
601
|
+
/** Its columns, in order. Empty for a statement that returns no rows (`CREATE TABLE`, `BEGIN`). */
|
|
602
|
+
columns: SqlScriptColumn[];
|
|
603
|
+
/** The tables and views its columns' {@link SqlScriptColumn.source} names. */
|
|
604
|
+
tables: SqlScriptTable[];
|
|
605
|
+
/** Its command: `SELECT`, `INSERT`, `CREATE TABLE` … */
|
|
606
|
+
command?: string;
|
|
607
|
+
/** How many rows it returned or changed, when its command reports a count; see {@link SqlScriptResult.rowCount}. */
|
|
608
|
+
rowCount?: number;
|
|
609
|
+
/** It returned more rows than the run kept, and {@link rows} holds its first ones. */
|
|
610
|
+
truncated?: boolean;
|
|
580
611
|
}
|
|
581
612
|
/**
|
|
582
613
|
* A query's result being read a batch at a time — see `SQLAdmin.openSqlCursor`.
|
package/dist/users/import.d.ts
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
* `client.admin.importUsers()` and `rebase users import`.
|
|
4
4
|
*
|
|
5
5
|
* An import keeps the ids the accounts had, so every row that points at a user
|
|
6
|
-
* still points at the same one
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* still points at the same one, and sends no email. It carries no password,
|
|
7
|
+
* except as the hash the other system stored, and only when the request names
|
|
8
|
+
* the algorithm ({@link IMPORTED_PASSWORD_HASH_ALGORITHMS}): such an account
|
|
9
|
+
* signs in with the password it had, and the hash is replaced by Rebase's own
|
|
10
|
+
* on its first sign-in. Any other imported account signs in by magic link, an
|
|
11
|
+
* email code, a provider, or a password reset.
|
|
9
12
|
*/
|
|
10
13
|
/**
|
|
11
14
|
* The most accounts one `POST /admin/users/import` takes. The CLI sends a
|
|
@@ -39,6 +42,30 @@ export declare const MAX_IMPORTED_USER_ID_LENGTH = 128;
|
|
|
39
42
|
* @group Admin
|
|
40
43
|
*/
|
|
41
44
|
export declare function importedUserIdProblem(id: unknown): string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* The password hash formats an import takes, as `passwordHashAlgorithm` names
|
|
47
|
+
* them. `bcrypt` is what Supabase (`auth.users.encrypted_password`), Auth0,
|
|
48
|
+
* Clerk and most Rails, Laravel and Django-bcrypt apps store: `$2a$`, `$2b$`
|
|
49
|
+
* or `$2y$`, a two-digit cost, then 53 characters.
|
|
50
|
+
*
|
|
51
|
+
* @group Admin
|
|
52
|
+
*/
|
|
53
|
+
export declare const IMPORTED_PASSWORD_HASH_ALGORITHMS: readonly ["bcrypt"];
|
|
54
|
+
/**
|
|
55
|
+
* One of {@link IMPORTED_PASSWORD_HASH_ALGORITHMS}.
|
|
56
|
+
*
|
|
57
|
+
* @group Admin
|
|
58
|
+
*/
|
|
59
|
+
export type ImportedPasswordHashAlgorithm = typeof IMPORTED_PASSWORD_HASH_ALGORITHMS[number];
|
|
60
|
+
/**
|
|
61
|
+
* Why `hash` is not a password hash of `algorithm` an import takes, or
|
|
62
|
+
* `undefined` when it is. Checked before anything is written, so a column of
|
|
63
|
+
* the wrong thing (a plain password, a scrypt string) fails the row instead
|
|
64
|
+
* of creating an account nobody can sign into.
|
|
65
|
+
*
|
|
66
|
+
* @group Admin
|
|
67
|
+
*/
|
|
68
|
+
export declare function importedPasswordHashProblem(hash: unknown, algorithm: ImportedPasswordHashAlgorithm): string | undefined;
|
|
42
69
|
/**
|
|
43
70
|
* One account to import.
|
|
44
71
|
*
|
|
@@ -63,6 +90,12 @@ export interface ImportUserInput {
|
|
|
63
90
|
emailVerified?: boolean;
|
|
64
91
|
/** Role names, as `POST /admin/users` takes them. No caller may grant a role above its own. */
|
|
65
92
|
roles?: string[];
|
|
93
|
+
/**
|
|
94
|
+
* The password hash the other system stored, taken only when the request
|
|
95
|
+
* names its algorithm in `passwordHashAlgorithm`. The account then signs
|
|
96
|
+
* in with the password it had. Omitted: no password, as before.
|
|
97
|
+
*/
|
|
98
|
+
passwordHash?: string;
|
|
66
99
|
}
|
|
67
100
|
/**
|
|
68
101
|
* The body of `POST /admin/users/import`.
|
|
@@ -74,6 +107,12 @@ export interface ImportUsersRequest {
|
|
|
74
107
|
users: ImportUserInput[];
|
|
75
108
|
/** Check every account and report what would happen, writing nothing. */
|
|
76
109
|
dryRun?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* The format of every `passwordHash` in `users`. Required when any account
|
|
112
|
+
* carries one: a hash whose format nobody declared is refused, never
|
|
113
|
+
* guessed at.
|
|
114
|
+
*/
|
|
115
|
+
passwordHashAlgorithm?: ImportedPasswordHashAlgorithm;
|
|
77
116
|
}
|
|
78
117
|
/**
|
|
79
118
|
* What happened to one account of an import. `index` is its place in the
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/types",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.36.0",
|
|
4
|
+
"description": "Shared type definitions for Rebase, the open-source Postgres BaaS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rebase",
|
|
7
7
|
"cms",
|
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
"typescript",
|
|
10
10
|
"headless",
|
|
11
11
|
"headless cms",
|
|
12
|
-
"content manager"
|
|
12
|
+
"content manager",
|
|
13
|
+
"baas",
|
|
14
|
+
"backend-as-a-service",
|
|
15
|
+
"postgres"
|
|
13
16
|
],
|
|
14
17
|
"homepage": "https://rebase.pro",
|
|
15
18
|
"bugs": {
|