@percher/core 0.2.5 → 0.2.6
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.
|
@@ -2,17 +2,28 @@ import { z } from "zod";
|
|
|
2
2
|
import type { Context } from "../context";
|
|
3
3
|
export declare const resetSuperuserInputSchema: z.ZodObject<{
|
|
4
4
|
app: z.ZodOptional<z.ZodString>;
|
|
5
|
+
/**
|
|
6
|
+
* When true, the API returns the plaintext password in the response so
|
|
7
|
+
* the CLI can print it once. Default false — the rotation succeeds and
|
|
8
|
+
* the new password lands in POCKETBASE_ADMIN_PASSWORD encrypted-at-rest,
|
|
9
|
+
* but no plaintext appears in any HTTP body. Users who only need the
|
|
10
|
+
* app to keep working don't see the credential at all; users who need
|
|
11
|
+
* to log into the PB admin UI directly opt in via `--reveal`.
|
|
12
|
+
*/
|
|
13
|
+
reveal: z.ZodOptional<z.ZodBoolean>;
|
|
5
14
|
}, "strip", z.ZodTypeAny, {
|
|
6
15
|
app?: string | undefined;
|
|
16
|
+
reveal?: boolean | undefined;
|
|
7
17
|
}, {
|
|
8
18
|
app?: string | undefined;
|
|
19
|
+
reveal?: boolean | undefined;
|
|
9
20
|
}>;
|
|
10
21
|
export type ResetSuperuserInput = z.infer<typeof resetSuperuserInputSchema>;
|
|
11
22
|
export interface ResetSuperuserResult {
|
|
12
23
|
message: string;
|
|
13
24
|
email: string;
|
|
14
|
-
/** Plaintext password —
|
|
15
|
-
password
|
|
25
|
+
/** Plaintext password — only present when invoked with `reveal: true`. */
|
|
26
|
+
password?: string;
|
|
16
27
|
}
|
|
17
28
|
export declare function resetSuperuser(ctx: Context, input?: ResetSuperuserInput): Promise<ResetSuperuserResult>;
|
|
18
29
|
//# sourceMappingURL=reset-superuser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-superuser.d.ts","sourceRoot":"","sources":["../../src/commands/reset-superuser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"reset-superuser.d.ts","sourceRoot":"","sources":["../../src/commands/reset-superuser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,eAAO,MAAM,yBAAyB;;IAEpC;;;;;;;OAOG;;;;;;;;EAEH,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,cAAc,CAClC,GAAG,EAAE,OAAO,EACZ,KAAK,GAAE,mBAAwB,GAC9B,OAAO,CAAC,oBAAoB,CAAC,CAS/B"}
|
|
@@ -3,6 +3,15 @@ import { readPercherTomlAppName } from "../app-name";
|
|
|
3
3
|
import { PercherCoreError } from "../errors";
|
|
4
4
|
export const resetSuperuserInputSchema = z.object({
|
|
5
5
|
app: z.string().optional(),
|
|
6
|
+
/**
|
|
7
|
+
* When true, the API returns the plaintext password in the response so
|
|
8
|
+
* the CLI can print it once. Default false — the rotation succeeds and
|
|
9
|
+
* the new password lands in POCKETBASE_ADMIN_PASSWORD encrypted-at-rest,
|
|
10
|
+
* but no plaintext appears in any HTTP body. Users who only need the
|
|
11
|
+
* app to keep working don't see the credential at all; users who need
|
|
12
|
+
* to log into the PB admin UI directly opt in via `--reveal`.
|
|
13
|
+
*/
|
|
14
|
+
reveal: z.boolean().optional(),
|
|
6
15
|
});
|
|
7
16
|
export async function resetSuperuser(ctx, input = {}) {
|
|
8
17
|
const appRef = input.app ?? readPercherTomlAppName(ctx.cwd);
|
|
@@ -12,6 +21,6 @@ export async function resetSuperuser(ctx, input = {}) {
|
|
|
12
21
|
hint: "Pass an app name or run from a directory with percher.toml.",
|
|
13
22
|
});
|
|
14
23
|
}
|
|
15
|
-
return ctx.client.apps.resetSuperuser(appRef);
|
|
24
|
+
return ctx.client.apps.resetSuperuser(appRef, { reveal: input.reveal });
|
|
16
25
|
}
|
|
17
26
|
//# sourceMappingURL=reset-superuser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-superuser.js","sourceRoot":"","sources":["../../src/commands/reset-superuser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"reset-superuser.js","sourceRoot":"","sources":["../../src/commands/reset-superuser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B;;;;;;;OAOG;IACH,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAUH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,GAAY,EACZ,QAA6B,EAAE;IAE/B,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,IAAI,sBAAsB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5D,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,gBAAgB,CAAC,4CAA4C,EAAE;YACvE,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,6DAA6D;SACpE,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AAC1E,CAAC"}
|