@camstack/sdk 0.1.46 → 0.1.48
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/index.cjs +28 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/dist/system.d.ts +22 -0
- package/package.json +6 -1
package/dist/index.js
CHANGED
|
@@ -1076,6 +1076,34 @@ class System {
|
|
|
1076
1076
|
const me = await this._trpcClient.auth.me.query();
|
|
1077
1077
|
return me;
|
|
1078
1078
|
}
|
|
1079
|
+
// ── Self-service auth (the signed-in user acting on themselves) ─────
|
|
1080
|
+
//
|
|
1081
|
+
// The hand-written `auth.*` router exposes 5 procedures that operate
|
|
1082
|
+
// on `ctx.user` (the JWT-bound identity), distinct from the admin
|
|
1083
|
+
// `user-management` cap that operates on arbitrary userIds. They live
|
|
1084
|
+
// on `System` rather than as codegen'd hooks because `auth.*` is a
|
|
1085
|
+
// legacy core router, not a `.cap.ts` — see the no-restricted-imports
|
|
1086
|
+
// rule in `eslint.config.mjs` for the canonical entry-point design.
|
|
1087
|
+
async changeOwnPassword(input) {
|
|
1088
|
+
const result = await this._trpcClient.auth.changeOwnPassword.mutate(input);
|
|
1089
|
+
return result;
|
|
1090
|
+
}
|
|
1091
|
+
async setupOwnTotp() {
|
|
1092
|
+
const result = await this._trpcClient.auth.setupOwnTotp.mutate();
|
|
1093
|
+
return result;
|
|
1094
|
+
}
|
|
1095
|
+
async confirmOwnTotp(input) {
|
|
1096
|
+
const result = await this._trpcClient.auth.confirmOwnTotp.mutate(input);
|
|
1097
|
+
return result;
|
|
1098
|
+
}
|
|
1099
|
+
async disableOwnTotp() {
|
|
1100
|
+
const result = await this._trpcClient.auth.disableOwnTotp.mutate();
|
|
1101
|
+
return result;
|
|
1102
|
+
}
|
|
1103
|
+
async getOwnTotpStatus() {
|
|
1104
|
+
const result = await this._trpcClient.auth.getOwnTotpStatus.query();
|
|
1105
|
+
return result;
|
|
1106
|
+
}
|
|
1079
1107
|
/** Update the auth token (e.g. after login or token refresh). */
|
|
1080
1108
|
setToken(token) {
|
|
1081
1109
|
this.token = token;
|